/**
  ************************************* Copyright ******************************
  * FileName   : io_ctrl.h
  * Version    : v1.0
  * Author     : yychao
  * Date       : 2023-08-07
  * Description:
  * Function List:
  	1. ....
  	   <version>:
  <modify staff>:
  		  <data>:
   <description>:
  	2. ...
  ******************************************************************************
 */

#ifndef __IO_CTRL_H_
#define __IO_CTRL_H_
#include "main.h"

struct ctrl_state {
    uint8_t status;
    uint8_t stage;
    uint8_t stage_item;
    uint8_t time_sta;
    uint8_t time_chk;
    uint8_t tab;

    uint8_t feed_start;
    uint8_t feed_cnt;

    uint8_t clear_start;
    uint8_t clear_cnt;

    uint32_t time_cnt;

    float now_dry_value;
    float final_dry_aim;
    float temp_dry_aim;
    float diff_value;

    float now_wet_value;
    float final_wet_aim;
    float temp_wet_aim;
    float wet_diff_value;

    float all_time;
    float residual_time;
    float past_time;


    float slope_k;
};
extern struct ctrl_state ctrl_state_st;
struct dev_sta {
    uint32_t fire;
    uint32_t feed;
    uint32_t clear;
    uint32_t burn_fan;
    uint32_t duty_ratio;
    float duty_ratio_f;
    uint32_t cycle_fan;
    uint32_t cycle_level;
    uint32_t air_door;
    uint32_t air_level;
};
extern struct dev_sta dev_sta_ready;
extern struct dev_sta dev_sta_real;

struct io_ctrl {
    uint8_t swh;
    uint8_t swl;
    uint16_t pwm1;
    uint16_t pwm2;
};
extern struct io_ctrl io_ctrl_st;


void ctrl_manage(void);
void io_ctrl_init(void);





#endif


